package com.liuqi09.mapper;

import com.liuqi09.po.Song;
import org.apache.ibatis.annotations.*;

/**
 * @author LiuQi
 * @create 2025-10-20-16:56
 */
@Mapper
public interface SongMapper {

    @Insert("insert into songs(title,artist,duration) values(#{title},#{artist},#{duration})")
    public int addSong(Song song);

    @Delete("delete from songs where id=#{id}")
    public int deleteSong(Integer id);

    @Update("update songs set title=#{title},artist=#{artist},duration=#{duration} where id=#{id}")
    public int updateSong(Song song);

    @Select("select * from songs where id=#{id}")
    public Song querySongById(Integer id);
}
